<html>
<head><meta charset="utf-8"><title>Moving `TyEncodable`/`TyDecodable` to `rustc_typeir` · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html">Moving `TyEncodable`/`TyDecodable` to `rustc_typeir`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224098613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224098613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224098613">(Jan 26 2021 at 20:32)</a>:</h4>
<p>hackmd: <a href="https://hackmd.io/DYGeIIHHSQah6g86piR1dQ">https://hackmd.io/DYGeIIHHSQah6g86piR1dQ</a></p>



<a name="224235918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224235918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224235918">(Jan 27 2021 at 19:34)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span> Not sure if you started on this yet, but I thought I'd help out by doing some digging into TyCtxt usages in TyDecoder. I'm leaving notes in the hackmd</p>



<a name="224236633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224236633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224236633">(Jan 27 2021 at 19:40)</a>:</h4>
<p>I had a chance for just a brief look today. Seems most of the time its the arena being used (from TyCtxt that is)</p>



<a name="224237590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224237590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224237590">(Jan 27 2021 at 19:48)</a>:</h4>
<p>So then we'd need to make <code>CtxtInterners</code> available from the interner?</p>



<a name="224237983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224237983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224237983">(Jan 27 2021 at 19:51)</a>:</h4>
<p>Ah, so even though <code>RustInterner</code> holds the whole TyCtxt, we should route all the method calls through the <code>Interner</code> trait</p>



<a name="224240618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224240618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224240618">(Jan 27 2021 at 20:12)</a>:</h4>
<p>I switched the topic here :)</p>



<a name="224241727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224241727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224241727">(Jan 27 2021 at 20:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125131">detrumi</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/224237983">said</a>:</p>
<blockquote>
<p>Ah, so even though <code>RustInterner</code> holds the whole TyCtxt, we should route all the method calls through the <code>Interner</code> trait</p>
</blockquote>
<p>that seems correct</p>



<a name="224242416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224242416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224242416">(Jan 27 2021 at 20:27)</a>:</h4>
<p>Do we just add a <code>type Arena = CtxtInterners</code> associated type to Interner then?</p>



<a name="224242589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224242589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224242589">(Jan 27 2021 at 20:28)</a>:</h4>
<p><del>We can't use the existing intern_* methods because those intern Chalk types</del><br>
Edit: oops, this is a different interner, nvm</p>



<a name="224243726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224243726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224243726">(Jan 27 2021 at 20:37)</a>:</h4>
<p>btw, I'm imagining that the interface of the "<code>Interner</code>" that gets added to <code>rustc_type_ir</code> now (or <code>rustc_middle</code> in the meantime) will look the same as the eventual <code>Interner</code> that's shared and look awfully close to the current chalk-ir <code>Interner</code></p>



<a name="224243838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224243838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224243838">(Jan 27 2021 at 20:37)</a>:</h4>
<p>There a bunch of <code>Copy</code> types in rustc that we don't require to be so in Chalk. That'll eventually get resolved in some way</p>



<a name="224253109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224253109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224253109">(Jan 27 2021 at 21:53)</a>:</h4>
<p>The decoders also call a bunch of <code>tcx.mk_*</code> functions, so those could be moved to the interner as well</p>



<a name="224253408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224253408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224253408">(Jan 27 2021 at 21:55)</a>:</h4>
<p>I mean, those are essentially the equivalent of chalk's <code>intern_*</code></p>



<a name="224253533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224253533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224253533">(Jan 27 2021 at 21:56)</a>:</h4>
<p>Yeah, the <code>mk_*</code> functions are just a wrapper around the <code>interners.intern_*</code> calls</p>



<a name="224303566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224303566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224303566">(Jan 28 2021 at 09:43)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> have you started working on it already ?</p>



<a name="224303703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224303703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224303703">(Jan 28 2021 at 09:45)</a>:</h4>
<p>Not really</p>



<a name="224303827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224303827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224303827">(Jan 28 2021 at 09:46)</a>:</h4>
<p>I left some notes on the tcx usages in the hackmd, and did some rough sketches locally to get an idea of what the interner would look like</p>



<a name="224304019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224304019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224304019">(Jan 28 2021 at 09:48)</a>:</h4>
<p>that will be helpful</p>



<a name="224304308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224304308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224304308">(Jan 28 2021 at 09:51)</a>:</h4>
<p>As a first step, I just put a concrete struct in rustc_middle:</p>
<div class="codehilite"><pre><span></span><code>#[derive(Copy, Clone)]
pub struct TyInterner&lt;&#39;tcx&gt; {
    tcx: TyCtxt&lt;&#39;tcx&gt;,
}

impl TyInterner&lt;&#39;tcx&gt; {
    pub fn new(tcx: TyCtxt&lt;&#39;tcx&gt;) -&gt; Self {
        Self { tcx }
    }
    pub fn mk_predicate(self, binder: Binder&lt;PredicateKind&lt;&#39;tcx&gt;&gt;) -&gt; Predicate&lt;&#39;tcx&gt; {
        let inner = self.tcx.interners.intern_predicate(binder);
        Predicate { inner }
    }
    pub fn arena(self) -&gt; &amp;&#39;tcx WorkerLocal&lt;Arena&lt;&#39;tcx&gt;&gt; {
        self.tcx.arena
    }
    pub fn ty_rcache(self) -&gt; Lock&lt;FxHashMap&lt;ty::CReaderCacheKey, Ty&lt;&#39;tcx&gt;&gt;&gt; {
        self.tcx.ty_rcache
    }
    pub fn queries(self) -&gt; query::Queries&lt;&#39;tcx&gt; {
        self.tcx.queries
    }
}
</code></pre></div>



<a name="224304463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224304463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224304463">(Jan 28 2021 at 09:53)</a>:</h4>
<p>Moving that to a trait which lives in rustc_type_ir would be trickier, because it uses several types that we don't want to move</p>



<a name="224305150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224305150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224305150">(Jan 28 2021 at 10:00)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...detrumi:tcx-to-interner-prototype">Branch with my changes so far</a></p>



<a name="224323779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224323779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FireFighterDuck <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224323779">(Jan 28 2021 at 13:17)</a>:</h4>
<p><del>Would it be possible for me to help you with this topic as well?</del> Sorry, this was not meant that way.</p>



<a name="224326356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224326356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224326356">(Jan 28 2021 at 13:40)</a>:</h4>
<p>Hmm. I know <span class="user-mention" data-user-id="283967">@Zahari Dichev</span> wants to try to approach this, and would rather let them try that without a bunch of people also doing the same thing</p>



<a name="224326372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224326372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224326372">(Jan 28 2021 at 13:41)</a>:</h4>
<p>But we can find something else :)</p>



<a name="224329699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224329699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224329699">(Jan 28 2021 at 14:06)</a>:</h4>
<p>I am certainly way in over my head. Playing with <span class="user-mention" data-user-id="125131">@detrumi</span>  branch now. So wrt to making it a trait. I guess we can flatten the methods the decodable uses on arena and put them on the trait. Do we ultimatelly want to move the Binder&lt;PredicateKind&gt; to <code>type_ir</code>? . I guess the <code>query::Queries</code>  is one of the tricky ones (although it is not used all that much... )</p>



<a name="224329962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224329962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224329962">(Jan 28 2021 at 14:08)</a>:</h4>
<p>Both <code>Binder</code> and <code>PredicateKind</code> are type-related in <code>rustc_middle::ty</code>, so yeah those should go to type_ir</p>



<a name="224330195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224330195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224330195">(Jan 28 2021 at 14:10)</a>:</h4>
<p>For queries and the like, we can either make the trait return the whole thing (with the result type being an associated type of the interner), or check whether we can make it more specific</p>



<a name="224330476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224330476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224330476">(Jan 28 2021 at 14:12)</a>:</h4>
<p>I think the more I look at it the more I get spooked.  move some stuff around and try to make your struct a trait</p>



<a name="224332378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224332378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224332378">(Jan 28 2021 at 14:26)</a>:</h4>
<p>When I tried that last time I ran into some issues with the return type of <code>TyDecoder::interner()</code>, as that changes from a concrete type to something like a trait object, but I'll see what I can do</p>



<a name="224332758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224332758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224332758">(Jan 28 2021 at 14:28)</a>:</h4>
<p>nevertheless quite a lot of stuff will have to move at once by the looks of it ..</p>



<a name="224333897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224333897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224333897">(Jan 28 2021 at 14:35)</a>:</h4>
<p>Ah, you mean the actual types like <code>PredicateKind</code>, yeah we only want to move those in a later step</p>



<a name="224334124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224334124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224334124">(Jan 28 2021 at 14:36)</a>:</h4>
<p>We could move all the <code>mk_*</code> functions to <code>CtxtInterners</code> instead, so the interner only has to grant access to that</p>



<a name="224335176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224335176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224335176">(Jan 28 2021 at 14:43)</a>:</h4>
<p>Although that would be a big refactor on its own, and changing all <code>tcx.mk_*</code> calls to <code>tcx.interner().interners().mk_*</code> to avoid moving everything at once would introduce too much indirection. Which we could solve by having a helper function <code>tcx.interners()</code> to be used when working with tcx, and <code>interner.interners()</code> when working with the interner.</p>



<a name="224336521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224336521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224336521">(Jan 28 2021 at 14:53)</a>:</h4>
<p>Ah wait, moving them to a <code>impl HasTyCtxt {}</code> block is better, as then we don't have to update usages for now</p>



<a name="224337236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224337236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224337236">(Jan 28 2021 at 14:57)</a>:</h4>
<p>Hm, it all comes down to all the mk_* functions that are directly on TyCtxt, which I'm not sure we can just refactor without something like a major change proposal</p>



<a name="224348781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224348781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224348781">(Jan 28 2021 at 16:09)</a>:</h4>
<p><code>OnDiskCache</code> is used in <code>impl Decodable for DefId</code>, but I don't think we want to pull that into the type library</p>



<a name="224352008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224352008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224352008">(Jan 28 2021 at 16:29)</a>:</h4>
<p>Yeah, I see what you meant now with <code>Arena</code>,  that's tricky because it's all in rustc_middle</p>



<a name="224354398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224354398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224354398">(Jan 28 2021 at 16:45)</a>:</h4>
<p>Even naming the types is hard, because <code>ArenaAllocatable</code> and such are instantiated through macros from rustc_middle</p>



<a name="224356540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224356540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224356540">(Jan 28 2021 at 16:53)</a>:</h4>
<p>So we need to either move the whole arena to rustc_type_ir, or refactor it to split the interface off from the implementation</p>



<a name="224360719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224360719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224360719">(Jan 28 2021 at 17:20)</a>:</h4>
<p>Yes, so I think we can go with the struct approach but as sson as we want to move that to a trait in the type library we need to shift a lot. Am I wrong?</p>



<a name="224390640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224390640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224390640">(Jan 28 2021 at 20:49)</a>:</h4>
<p>You're not wrong. Not sure if it's better to refactor first or just do the move</p>



<a name="224391839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224391839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224391839">(Jan 28 2021 at 20:59)</a>:</h4>
<p>yeah just moving the arena alone is a big one. If we do a ton of effort to just move out a trait that is going to be laregely different when the other types are moved... not sure if it makes sense. But I am pretty new to the codebase so it hard for me to tell</p>



<a name="224512797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224512797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224512797">(Jan 29 2021 at 18:17)</a>:</h4>
<p>So I added some notes to the hackmd with pointers to the types, but frankly speaking I am a bit lost on how to shift all of that or even abstract it away. It seems to me that a lot needs to move and it is hard for me to tell what we want to move and what we do not want to touch.</p>



<a name="224513158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224513158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224513158">(Jan 29 2021 at 18:19)</a>:</h4>
<p>Let me look over what you wrote</p>



<a name="224513441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224513441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224513441">(Jan 29 2021 at 18:21)</a>:</h4>
<p>Well, looks like this is going to be tough</p>



<a name="224513849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224513849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224513849">(Jan 29 2021 at 18:24)</a>:</h4>
<blockquote>
<p>It seems to me that a lot needs to move and it is hard for me to tell what we want to move and what we do not want to touch.</p>
</blockquote>
<p>I think this is going to require a bit of experimenting. I think most "types" will get abstracted out by putting things behind associated types of a trait with associated functions to manipulate them. (Think of <code>SlgContext</code> from when <code>chalk-solve</code> and <code>chalk-ir</code> depended on <code>chalk-engine</code>, instead of the other way around)</p>



<a name="224514000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224514000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224514000">(Jan 29 2021 at 18:25)</a>:</h4>
<p>It's probably easiest to start by defining an empty <code>Interner</code> trait, and add what you need to it to get things to work</p>



<a name="224514220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224514220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224514220">(Jan 29 2021 at 18:27)</a>:</h4>
<p>a side question, In theory, if there was a type lib in place at the moment (a complete one), I guess the whole lowering that is done by <code>LowerInto</code> would not be needed, correct ?</p>



<a name="224567752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224567752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224567752">(Jan 30 2021 at 05:45)</a>:</h4>
<p>Yes, that's the plan!</p>



<a name="224574376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224574376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224574376">(Jan 30 2021 at 08:59)</a>:</h4>
<p>It's mainly the <code>mk_*</code> methods that need a lot of associated types. For the query/cache we just need to figure out the right interface, and the arena is a bit more involved because of how all the types are generated by macros</p>



<a name="224632814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224632814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224632814">(Jan 31 2021 at 08:56)</a>:</h4>
<p>Is there a way to put this function on the interner trait without moving <code>ArenaAllocatable</code> from rustc_middle?</p>
<div class="codehilite"><pre><span></span><code>pub fn alloc&lt;T: ArenaAllocatable&lt;&#39;tcx, U&gt;, U&gt;(&amp;self, value: T) -&gt; &amp;mut T
</code></pre></div>
<p>That comes down to something along the lines of <code>type T = for&lt;U&gt; T: ArenaAllocatable&lt;'tcx, U&gt;</code>, which we can't express yet</p>



<a name="224666772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224666772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224666772">(Jan 31 2021 at 21:55)</a>:</h4>
<p>What is this used for? Could just have it be on concrete types (or associated types)</p>



<a name="224668589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224668589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224668589">(Jan 31 2021 at 22:10)</a>:</h4>
<p>The decoder traits use such calls: <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/codec.rs#L346">https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/codec.rs#L346</a></p>



<a name="224669572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224669572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224669572">(Jan 31 2021 at 22:24)</a>:</h4>
<p>The concrete types are in rustc_middle, which the trait can't reference. And making it an associated type would require GATs, no?</p>



<a name="224686103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224686103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224686103">(Feb 01 2021 at 05:03)</a>:</h4>
<p>I mean, at worst you could just have a <code>decode_predicate_span_slice</code> associated function on the <code>Interner</code>. But there are certainly ways to make that slightly more abstract.</p>



<a name="224686119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224686119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224686119">(Feb 01 2021 at 05:03)</a>:</h4>
<p>Where do you think there would be GATs?</p>



<a name="224737344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224737344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224737344">(Feb 01 2021 at 15:00)</a>:</h4>
<p>Ah, that's an idea, putting the decode functions themselves in the interner trait</p>



<a name="224749705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224749705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224749705">(Feb 01 2021 at 16:14)</a>:</h4>
<p><a href="/user_uploads/4715/SYizCqyymP_rdFL0-CYu9_dP/image.png">image.png</a> <br>
Not the cleanest, but it works</p>
<div class="message_inline_image"><a href="/user_uploads/4715/SYizCqyymP_rdFL0-CYu9_dP/image.png" title="image.png"><img src="/user_uploads/4715/SYizCqyymP_rdFL0-CYu9_dP/image.png"></a></div>



<a name="224749815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224749815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224749815">(Feb 01 2021 at 16:15)</a>:</h4>
<p>It's a start!</p>



<a name="224749833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224749833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224749833">(Feb 01 2021 at 16:15)</a>:</h4>
<p>Again, you can always make it a bit more abstract</p>



<a name="224757402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224757402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224757402">(Feb 01 2021 at 17:02)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> seems you are getting your hands dirty with all this (as compared to me struggling :D ), should I try and pick up smth else ?</p>



<a name="224760573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224760573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224760573">(Feb 01 2021 at 17:22)</a>:</h4>
<p>You say that as if I'm not struggling as well <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="224761317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224761317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224761317">(Feb 01 2021 at 17:27)</a>:</h4>
<p>I can relate...</p>



<a name="224762103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224762103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224762103">(Feb 01 2021 at 17:33)</a>:</h4>
<p>So uh, I'm just trying to get this whole thing started. We can work on it together or you can take over from here, or you can pick something else if you want something more self-contained (although finding something suitable to work on can be the hard part)</p>



<a name="224764097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764097">(Feb 01 2021 at 17:46)</a>:</h4>
<p>I think I am more than happy to use some help with  getting this started.</p>



<a name="224764255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764255">(Feb 01 2021 at 17:48)</a>:</h4>
<p>Cool, I should be able to help with that</p>



<a name="224764322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764322">(Feb 01 2021 at 17:48)</a>:</h4>
<p>Want to do another sync call to talk through the design some more?</p>



<a name="224764576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764576">(Feb 01 2021 at 17:50)</a>:</h4>
<p>cannot right now but should be able to tomorrow.  We are in a similar time zone</p>



<a name="224764600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764600">(Feb 01 2021 at 17:51)</a>:</h4>
<p>ah, nice</p>



<a name="224764700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224764700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224764700">(Feb 01 2021 at 17:51)</a>:</h4>
<p>you have time during the day ?</p>



<a name="224765210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224765210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224765210">(Feb 01 2021 at 17:54)</a>:</h4>
<p>Sure, how about 12:00 UTC? (13:00 my time, 14:00 in yours)</p>



<a name="224765684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224765684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224765684">(Feb 01 2021 at 17:57)</a>:</h4>
<p><time datetime="2021-02-02T12:00:00Z">2021-02-02T13:00:00+01:00</time></p>



<a name="224765876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224765876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224765876">(Feb 01 2021 at 17:58)</a>:</h4>
<p>sounds great !</p>



<a name="224766137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224766137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224766137">(Feb 01 2021 at 18:00)</a>:</h4>
<p>Great. Let's go for Zoom I guess</p>



<a name="224861297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224861297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224861297">(Feb 02 2021 at 11:58)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> here in a few mins</p>



<a name="224861369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224861369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224861369">(Feb 02 2021 at 11:59)</a>:</h4>
<p>Will PM you a zoom invite</p>



<a name="224879807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224879807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224879807">(Feb 02 2021 at 14:42)</a>:</h4>
<p>so <span class="user-mention" data-user-id="125131">@detrumi</span> what is the reason for the interner to be <code>Interner&lt;D: Decoder&gt;</code> instead of simply <code>Interner</code></p>



<a name="224880197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224880197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224880197">(Feb 02 2021 at 14:45)</a>:</h4>
<p>Because Interner::Predicate needs a bound on <code>Decodable&lt;D&gt;</code>. There's 2 impls for Decoder, I haven't checked if we needed both of them</p>



<a name="224880454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224880454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224880454">(Feb 02 2021 at 14:47)</a>:</h4>
<p>Having <code>type Predicate: Decodable&lt;Decoder&gt;;</code> on the interner trait instead would be nicer, but that only works if all interner usages use the same concrete decoder type</p>



<a name="224880771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224880771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224880771">(Feb 02 2021 at 14:49)</a>:</h4>
<p>yes.. and having the generic <code>D</code> indeed makes it a bit hard to implement the trait on <code>TyCtxt</code>  directly</p>



<a name="224880976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224880976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224880976">(Feb 02 2021 at 14:50)</a>:</h4>
<p>Is it? Doesn't <code>impl&lt;'tcx&gt; Interner&lt;Decoder&gt; for TyCtxt&lt;'tcx&gt;</code> work?</p>



<a name="224881215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224881215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224881215">(Feb 02 2021 at 14:52)</a>:</h4>
<p>Yes sorry, my bad that worked fine indeed</p>



<a name="224894594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224894594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224894594">(Feb 02 2021 at 16:20)</a>:</h4>
<p>Might not actually work in the end, because that picks one of the 2 concrete decoders, and they might both be used</p>



<a name="224902868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224902868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224902868">(Feb 02 2021 at 17:10)</a>:</h4>
<p>an ultimatelly <code>TypeDecoder::interner</code> should be giving us the interner trait rather than the <code>TyCtxt / TyInterner</code> correct ?</p>



<a name="224903186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224903186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224903186">(Feb 02 2021 at 17:12)</a>:</h4>
<p>That'd require returning <code>dyn Interner</code></p>



<a name="224903300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224903300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224903300">(Feb 02 2021 at 17:12)</a>:</h4>
<p>as long as TypeDecoder knows the concrete type, I don't see why we would want to return the trait there</p>



<a name="224907263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224907263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224907263">(Feb 02 2021 at 17:37)</a>:</h4>
<p>I was under the impression that <code>TyDecoder</code> will   move to the <code>rustc_typeir</code></p>



<a name="224907558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224907558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224907558">(Feb 02 2021 at 17:39)</a>:</h4>
<p>I think you're right, I'm just a bit confused with what should move and what shouldn't</p>



<a name="224908089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224908089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224908089">(Feb 02 2021 at 17:43)</a>:</h4>
<p>well yes me as well...</p>



<a name="224908156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224908156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224908156">(Feb 02 2021 at 17:44)</a>:</h4>
<p>however. if we move the <code>TyDecoder</code>, then we will not know about the concrete type.</p>



<a name="224908251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224908251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224908251">(Feb 02 2021 at 17:45)</a>:</h4>
<p>Right</p>



<a name="224909269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/224909269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#224909269">(Feb 02 2021 at 17:52)</a>:</h4>
<p>But we can put that question off for now, as we're only trying to move types and such in this first move</p>



<a name="225314116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314116">(Feb 05 2021 at 15:40)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> I moved some more calls into the TyInterner. Here is my branch. Will try and take a see what can be done with all the arena methods</p>



<a name="225314123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314123">(Feb 05 2021 at 15:40)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1">https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1</a></p>



<a name="225314242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314242">(Feb 05 2021 at 15:40)</a>:</h4>
<p>On another note I wonder how we can avoid all the <code>&lt;TyInterner&lt;'tcx&gt; as Interner&lt;D&gt;&gt;::</code> bits</p>



<a name="225314290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314290">(Feb 05 2021 at 15:41)</a>:</h4>
<p>Ah nice, so alloc functions and some more types</p>



<a name="225314368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314368">(Feb 05 2021 at 15:41)</a>:</h4>
<p>yes</p>



<a name="225314472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314472">(Feb 05 2021 at 15:42)</a>:</h4>
<p>I think it is mostly the arena that is left. Will try and see what can be done with that soon</p>



<a name="225314484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314484">(Feb 05 2021 at 15:42)</a>:</h4>
<p>Yeah, so about that decoder parameter...</p>



<a name="225314550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314550">(Feb 05 2021 at 15:42)</a>:</h4>
<p>Do you know if both decoders are actually used, or could we name the concrete decoder instead?</p>



<a name="225314603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314603">(Feb 05 2021 at 15:43)</a>:</h4>
<p>Btw since you are working together on this, feel free to create/use a branch in the rust-lang/chalk repo</p>



<a name="225314655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314655">(Feb 05 2021 at 15:43)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> Heh, this is a rustc (fork) branch though</p>



<a name="225314801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314801">(Feb 05 2021 at 15:44)</a>:</h4>
<p>I mean, unless you can create a rustc branch inside the chalk repo?</p>



<a name="225314899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314899">(Feb 05 2021 at 15:45)</a>:</h4>
<p>not sure whether both decoders are used but even if not, we would ideally want to be able to leave that generic, right?</p>



<a name="225314964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314964">(Feb 05 2021 at 15:45)</a>:</h4>
<p>also there are few other bits that bug me</p>



<a name="225314980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225314980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225314980">(Feb 05 2021 at 15:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125131">detrumi</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/225314655">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> Heh, this is a rustc (fork) branch though</p>
</blockquote>
<p><span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span>‍♀️oops nvm</p>



<a name="225315177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315177">(Feb 05 2021 at 15:47)</a>:</h4>
<p>namely... I feel like fn <code>TyDecoder::interner(&amp;self)</code> should be returning <code>impl Interner</code> rather than <code>TyInterner&lt;'tcx&gt;</code></p>



<a name="225315186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315186">(Feb 05 2021 at 15:47)</a>:</h4>
<p>isnt that right ?</p>



<a name="225315419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315419">(Feb 05 2021 at 15:48)</a>:</h4>
<p>after all.. I assume <code>TyDecoder</code> will move to the shared lib, right ?</p>



<a name="225315446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315446">(Feb 05 2021 at 15:48)</a>:</h4>
<p>Ah, don't know about that (TyDecoder moving to the shared lib)</p>



<a name="225315470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315470">(Feb 05 2021 at 15:48)</a>:</h4>
<p>But I guess it's good from a API purity standpoint</p>



<a name="225315511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315511">(Feb 05 2021 at 15:49)</a>:</h4>
<p>in that it would prevent using TyInterner functions that aren't on the trait</p>



<a name="225315641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315641">(Feb 05 2021 at 15:50)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> WDYT wrt to moving the decoder trait ?</p>



<a name="225315811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315811">(Feb 05 2021 at 15:51)</a>:</h4>
<p>This sounds specific to rustc's allocations, while the interner trait should be generic over the type representation</p>



<a name="225315819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315819">(Feb 05 2021 at 15:51)</a>:</h4>
<p>ah wait nvm we cannot return impl Trait from the Decoder trait because imple returns are not allowed in traits....</p>



<a name="225315934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315934">(Feb 05 2021 at 15:52)</a>:</h4>
<p>The alternative is a trait object</p>



<a name="225315987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225315987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225315987">(Feb 05 2021 at 15:52)</a>:</h4>
<p>I'm not sure how much I can weigh in rn. Not mentally in this context currently</p>



<a name="225316964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225316964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225316964">(Feb 05 2021 at 15:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="283967">Zahari Dichev</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/225314242">said</a>:</p>
<blockquote>
<p>On another note I wonder how we can avoid all the <code>&lt;TyInterner&lt;'tcx&gt; as Interner&lt;D&gt;&gt;::</code> bits</p>
</blockquote>
<p>So we have this <code>type Predicate: Decodable&lt;D&gt;</code> bound, but even though it should be decodable with any decoder, we have to pick one</p>



<a name="225316980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225316980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225316980">(Feb 05 2021 at 15:59)</a>:</h4>
<p>Ah, I see what I did wrong there</p>



<a name="225317151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225317151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225317151">(Feb 05 2021 at 16:00)</a>:</h4>
<p>Would it help to change it to <code>type Predicate: Decodable&lt;D: Decoder&gt;</code>? This feels like something implied bounds should get us for free, but maybe that doesn't apply here</p>



<a name="225317995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225317995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225317995">(Feb 05 2021 at 16:05)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0658]: associated type bounds are unstable
  --&gt; compiler/rustc_type_ir/src/lib.rs:21:31
   |
21 |     type Predicate: Decodable&lt;D: Decoder&gt;;
   |                               ^^^^^^^^^^
   |
   = note: see issue #52662 &lt;https://github.com/rust-lang/rust/issues/52662&gt; for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0107]: wrong number of type arguments: expected 1, found 0
  --&gt; compiler/rustc_type_ir/src/lib.rs:21:21
   |
21 |     type Predicate: Decodable&lt;D: Decoder&gt;;
   |                     ^^^^^^^^^^^^^^^^^^^^^ expected 1 type argument

error[E0220]: associated type `D` not found for `Decodable&lt;[type error]&gt;`
  --&gt; compiler/rustc_type_ir/src/lib.rs:21:31
   |
21 |     type Predicate: Decodable&lt;D: Decoder&gt;;
   |                               ^ associated type `D` not found

error: aborting due to 3 previous errors
</code></pre></div>



<a name="225318234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225318234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225318234">(Feb 05 2021 at 16:06)</a>:</h4>
<p>Heh, of course GATs would also help here, how ironic</p>



<a name="225318759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225318759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225318759">(Feb 05 2021 at 16:10)</a>:</h4>
<p>Hm, weird. Apparently it just works if you remove all those bounds?</p>



<a name="225318945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225318945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225318945">(Feb 05 2021 at 16:11)</a>:</h4>
<p>Remove the <code>D</code> parameter from <code>Interner</code> and the associated types and it just works <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="225319476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225319476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225319476">(Feb 05 2021 at 16:15)</a>:</h4>
<p>I originally added those bounds because something wasn't working, but maybe some change afterwards made it unnecessary</p>



<a name="225601510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225601510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225601510">(Feb 08 2021 at 20:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="283967">Zahari Dichev</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/225315419">said</a>:</p>
<blockquote>
<p>after all.. I assume <code>TyDecoder</code> will move to the shared lib, right ?</p>
</blockquote>
<p>I did some digging into the code generated by the derives, and since the <code>TyEncodable</code> derive uses <code>TyEncoder</code>, I'm now convinced that <code>TyEncodable</code> should be moved (alongside <code>TyDecoder</code> and <code>RefDecodable</code>). So <span class="user-mention" data-user-id="283967">@Zahari Dichev</span> you were totally right</p>



<a name="225602533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225602533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225602533">(Feb 08 2021 at 20:26)</a>:</h4>
<p>As for the other derives, interestingly the <code>HashStable</code> derive generates a <code>HashStable&lt;StableHashingContext&gt;</code> impl, and that context (rustc_middle::ich::StableHashingContext) lives in rustc_middle and can't really be moved. Not sure yet how to untangle that</p>



<a name="225602956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225602956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225602956">(Feb 08 2021 at 20:29)</a>:</h4>
<p>There's also the <code>HashStable_Generic</code> derive</p>



<a name="225603142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225603142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225603142">(Feb 08 2021 at 20:30)</a>:</h4>
<p>Ah right, looks like that's made especially for the use case of deriving HashStable outside of rustc_middle</p>



<a name="225751901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225751901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225751901">(Feb 09 2021 at 20:25)</a>:</h4>
<p>@detrumi I will not be able to make it to today's meeting but here is my branch. It is the arena methods that still need moving to the interner: <a href="https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1">https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1</a> I am still not entirely sure how to go about that</p>



<a name="225753769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225753769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225753769">(Feb 09 2021 at 20:38)</a>:</h4>
<p>Nice, so the arena methods are the only thing missing from the interner trait?</p>



<a name="225754295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225754295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225754295">(Feb 09 2021 at 20:43)</a>:</h4>
<p>I think the RefDecodable impls also need to be updated, and those contain some more functions that need to be in the trait. <del>Same thing with TyEncoder</del></p>



<a name="225822999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/225822999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#225822999">(Feb 10 2021 at 11:29)</a>:</h4>
<p>As for the arena methods: ideally that'd fit into something like this, but that doesn't quite work because the trait doesn't know of <code>'tcx</code>:</p>
<div class="codehilite"><pre><span></span><code>fn alloc_from_iter&lt;T: Copy&gt;(self, iter: impl IntoIterator&lt;Item = T&gt;) -&gt; &amp;&#39;tcx mut [T]
</code></pre></div>
<p>So for now we can go with concrete methods for each type instantiation, so we get <code>alloc_symbol</code>, <code>alloc_def</code> etc.</p>



<a name="226141090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226141090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226141090">(Feb 12 2021 at 14:12)</a>:</h4>
<p>I just pushed into the branch and there is only the arena left. I think the arena work is complicated by the fact that a lot of the decoder impls are also defined in a macro and make use of <code>decode_arena_allocable</code>/<code>decode_arena_allocable_slice</code>. <span class="user-mention" data-user-id="125131">@detrumi</span> maybe you can provide some hints here.  You think there is a more elegant way than providing separate methods for all types ?</p>



<a name="226142096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226142096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226142096">(Feb 12 2021 at 14:21)</a>:</h4>
<p>Like I wrote above, the things I tried didn't really work out, unless we introduce a lifetime to the interner trait, which might or might not be an improvement</p>



<a name="226143909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226143909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226143909">(Feb 12 2021 at 14:36)</a>:</h4>
<p>seems like if we have a lifetime we can get rid of  type like <code>ListGenericArg</code></p>



<a name="226144078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226144078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226144078">(Feb 12 2021 at 14:38)</a>:</h4>
<p>alternatively, yeah its just providing all the different methods, which seems far from ideal..</p>



<a name="226388557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226388557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226388557">(Feb 15 2021 at 14:11)</a>:</h4>
<p>I think I am a bit stuck here. If we avoid the lifetime, it seems we need to provide different arena methods for all types for which the decoder is implemented via the macros, which can be found here: <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/arena.rs">https://github.com/rust-lang/rust/blob/master/compiler/rustc_hir/src/arena.rs</a> and here: <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/arena.rs">https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/arena.rs</a>  Does that sound right. This kind of feels a bit detached from the right approch but am not quite sure what else is better</p>



<a name="226388706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226388706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226388706">(Feb 15 2021 at 14:12)</a>:</h4>
<p>I was assuming we'd only need the types that are actually mentioned in the decodable impls</p>



<a name="226389112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/226389112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#226389112">(Feb 15 2021 at 14:16)</a>:</h4>
<p>And that should be only about 3-5 from what I saw</p>



<a name="227095614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227095614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227095614">(Feb 20 2021 at 14:44)</a>:</h4>
<p>@detrumi  yes I extracted these and it all compiles well except for the Span allocation on the arena. That is causing some compile problems that I cannot quite understand the source of</p>



<a name="227095637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227095637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227095637">(Feb 20 2021 at 14:45)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0283]: type annotations needed
   --&gt; compiler/rustc_middle/src/ty/context.rs:206:24
    |
206 |         self.tcx.arena.alloc_from_iter(iter)
    |                        ^^^^^^^^^^^^^^^ cannot infer type for type parameter `U` declared on the associated function `alloc_from_iter`
    |
    = note: cannot satisfy `rustc_span::Span: ArenaAllocatable&lt;&#39;_, _&gt;`

error: aborting due to 2 previous errors
</code></pre></div>



<a name="227095643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227095643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227095643">(Feb 20 2021 at 14:45)</a>:</h4>
<p>pushed into the same branch <a href="https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1">https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1</a></p>



<a name="227106084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227106084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227106084">(Feb 20 2021 at 17:40)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span> So that's the <code>T:ArenaAllocatable&lt; 'tcx,U&gt;</code> bound again that's causing trouble</p>



<a name="227106219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227106219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227106219">(Feb 20 2021 at 17:42)</a>:</h4>
<p>It's not obvious why this works for the other from_iter functions but not not this one</p>



<a name="227106303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227106303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227106303">(Feb 20 2021 at 17:44)</a>:</h4>
<p>Maybe because it's because <code>Span</code> doesn't take a <code>'tcx</code> like the others do...</p>



<a name="227106326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227106326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227106326">(Feb 20 2021 at 17:44)</a>:</h4>
<p>Ah no, that's the same as <code>CodeRegion</code></p>



<a name="227106472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227106472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227106472">(Feb 20 2021 at 17:47)</a>:</h4>
<p>Ah, <code>Span</code> isn't defined in rustc_middle, so it can't derive TyEncodable/TyDecodable directly. That's probably what's different</p>



<a name="227107970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227107970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227107970">(Feb 20 2021 at 18:13)</a>:</h4>
<p>Maybe it can't infer <code>U</code> because the type is <code>Self::Span</code>, which doesn't (and probably can't) have a <code>ArenaAllocatable</code> bound</p>



<a name="227108192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227108192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227108192">(Feb 20 2021 at 18:16)</a>:</h4>
<p>Tricky, we can't mention the generic args explicitly because it's an impl trait arg</p>



<a name="227262823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227262823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227262823">(Feb 22 2021 at 13:05)</a>:</h4>
<p>Yeah, not too sure what exactly can be done about that one...</p>



<a name="227263344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227263344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227263344">(Feb 22 2021 at 13:10)</a>:</h4>
<p>Any ideas ?</p>



<a name="227263870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227263870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227263870">(Feb 22 2021 at 13:14)</a>:</h4>
<p>I tried inlining the first <code>alloc_from_iter</code> (the one on Arena), but that still has the same problem</p>



<a name="227264046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227264046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227264046">(Feb 22 2021 at 13:15)</a>:</h4>
<p>Maybe calling <code>T::allocate_from_iter</code> directly on the concrete type would improve things</p>



<a name="227265497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227265497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227265497">(Feb 22 2021 at 13:28)</a>:</h4>
<p>yeah I tried using <code>allocate_from_iter</code> as well but no luck</p>



<a name="227268861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227268861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227268861">(Feb 22 2021 at 13:52)</a>:</h4>
<p>yeah and moving Span to rustc_middle is a no go. I am really not sure what to do here</p>



<a name="227507148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227507148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227507148">(Feb 23 2021 at 21:33)</a>:</h4>
<p>Howdy :) I've somewhat been following here (but not really thinking too hard). Anything I can help with?</p>



<a name="227507851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227507851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227507851">(Feb 23 2021 at 21:38)</a>:</h4>
<p>I think the first step is mostly complete, except for a specific arena allocation for <code>Span</code>: <a href="https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1#diff-0c8c9cf0c0f8cda43eb64bbe5ef63c3239b0cf25901587b3c1f2b1d97a7e8441R196">https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1#diff-0c8c9cf0c0f8cda43eb64bbe5ef63c3239b0cf25901587b3c1f2b1d97a7e8441R196</a></p>



<a name="227508140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508140">(Feb 23 2021 at 21:40)</a>:</h4>
<p>That still fails because it can't infer the type param <code>U</code>, and things don't work out because of the <code>impl IntoIterator</code> param, and the fact that <code>Span</code> isn't defined in rustc_middle</p>



<a name="227508707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508707">(Feb 23 2021 at 21:44)</a>:</h4>
<p>Is that supposed to be pointing to a line?</p>



<a name="227508760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508760">(Feb 23 2021 at 21:45)</a>:</h4>
<p>Oh ugh, it doesn't expand</p>



<a name="227508810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508810">(Feb 23 2021 at 21:45)</a>:</h4>
<p>context.rs:196</p>



<a name="227508829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508829">(Feb 23 2021 at 21:45)</a>:</h4>
<p>yes, just found that</p>



<a name="227508853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508853">(Feb 23 2021 at 21:45)</a>:</h4>
<p>yeah, that's an unfortunate bit of github</p>



<a name="227508969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227508969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227508969">(Feb 23 2021 at 21:46)</a>:</h4>
<p>Where is <code>U</code> here?</p>



<a name="227509060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509060">(Feb 23 2021 at 21:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_arena/src/lib.rs#L736">https://github.com/rust-lang/rust/blob/master/compiler/rustc_arena/src/lib.rs#L736</a></p>



<a name="227509065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509065">(Feb 23 2021 at 21:47)</a>:</h4>
<p>I'm guessing on <code>alloc_from_iter</code></p>



<a name="227509096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509096">(Feb 23 2021 at 21:47)</a>:</h4>
<p>ninja'd</p>



<a name="227509178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509178">(Feb 23 2021 at 21:47)</a>:</h4>
<p>And trying <code>Span::allocate_from_iter(self.tcx.arena, iter)</code> results in <code>cannot satisfy rustc_span::Span: ArenaAllocatable&lt;'_, _&gt;</code></p>



<a name="227509329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509329">(Feb 23 2021 at 21:48)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0283]: type annotations needed
   --&gt; compiler/rustc_middle/src/ty/context.rs:196:9
    |
196 |         Span::allocate_from_iter(self.tcx.arena, iter)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `T` declared on the trait `ArenaAllocatable`
    |
   ::: /home/wilco/p/rust/rust/compiler/rustc_arena/src/lib.rs:669:16
    |
669 |             fn allocate_from_iter&lt;&#39;a&gt;(
    |                ------------------ required by a bound in this
670 |                 arena: &amp;&#39;a Arena&lt;&#39;tcx&gt;,
671 |                 iter: impl ::std::iter::IntoIterator&lt;Item = Self&gt;,
    |                                                      ----------- required by this bound in `ArenaAllocatable::allocate_from_iter`
    |
    = note: cannot satisfy `rustc_span::Span: ArenaAllocatable&lt;&#39;_, _&gt;`
help: consider specifying the type argument in the function call
    |
196 |         Span::allocate_from_iter::&lt;impl ::std::iter::IntoIterator&lt;Item = Self&gt;&gt;(self.tcx.arena, iter)
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>



<a name="227509408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509408">(Feb 23 2021 at 21:49)</a>:</h4>
<p>(the hint doesn't work because 'impl trait' isn't allowed there)</p>



<a name="227509531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509531">(Feb 23 2021 at 21:50)</a>:</h4>
<p>Where is the <code>ArenaAllocatable</code> impl supposed to be here?</p>



<a name="227509601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509601">(Feb 23 2021 at 21:50)</a>:</h4>
<p>It's inside the <code>declare_arena!</code> macro</p>



<a name="227509687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509687">(Feb 23 2021 at 21:51)</a>:</h4>
<p>... which is called in combination with the <code>arena_types!</code> macro, to make all of this more confusing</p>



<a name="227509840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509840">(Feb 23 2021 at 21:52)</a>:</h4>
<p>One second, let me get a handle on things</p>



<a name="227509959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227509959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227509959">(Feb 23 2021 at 21:53)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_arena/src/lib.rs#L705">https://github.com/rust-lang/rust/blob/master/compiler/rustc_arena/src/lib.rs#L705</a> that's what I was missing :)</p>



<a name="227510066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510066">(Feb 23 2021 at 21:54)</a>:</h4>
<p>wait, no</p>



<a name="227510164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510164">(Feb 23 2021 at 21:55)</a>:</h4>
<p>could you do something like <code>self.tcx.arena.alloc_from_iter::&lt;'_, _, Span&gt;(iter)</code></p>



<a name="227510330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510330">(Feb 23 2021 at 21:56)</a>:</h4>
<p>Nope:</p>
<div class="codehilite"><pre><span></span><code>error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
</code></pre></div>



<a name="227510390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510390">(Feb 23 2021 at 21:57)</a>:</h4>
<p><span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span>‍♀️</p>



<a name="227510410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510410">(Feb 23 2021 at 21:57)</a>:</h4>
<p>The error message is kinda wild: <code>cannot specify lifetime arguments explicitly if late bound lifetime parameters are present</code></p>



<a name="227510479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510479">(Feb 23 2021 at 21:57)</a>:</h4>
<p>err wait</p>



<a name="227510550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510550">(Feb 23 2021 at 21:58)</a>:</h4>
<p>it should be <code>&lt;'_, Span, _&gt;</code> right?</p>



<a name="227510609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510609">(Feb 23 2021 at 21:58)</a>:</h4>
<p><code>U</code> is the third parameter though, and it couldn't infer that one</p>



<a name="227510679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510679">(Feb 23 2021 at 21:59)</a>:</h4>
<p>But even having <code>_</code> is not allowed, it's still counted as explicit</p>



<a name="227510729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227510729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227510729">(Feb 23 2021 at 21:59)</a>:</h4>
<p>What is that <code>U</code> even used for...</p>



<a name="227511107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511107">(Feb 23 2021 at 22:01)</a>:</h4>
<p>And you can't do <code>&lt;'_, Span, Span&gt;</code></p>



<a name="227511463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511463">(Feb 23 2021 at 22:02)</a>:</h4>
<p>Or <code>Span::allocate_from_iter::&lt;'_, Span, Span&gt;(self.tcx.arena, iter)</code></p>



<a name="227511475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511475">(Feb 23 2021 at 22:02)</a>:</h4>
<p>Nope, it's not even looking at what you pass in, any explicit arg is not allowed</p>



<a name="227511583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511583">(Feb 23 2021 at 22:02)</a>:</h4>
<p>Because of the <code>impl IntoIterator</code>?</p>



<a name="227511619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511619">(Feb 23 2021 at 22:02)</a>:</h4>
<p>Could you just...not have that...</p>



<a name="227511661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511661">(Feb 23 2021 at 22:03)</a>:</h4>
<p>And just make a <code>T: IntoIterator</code></p>



<a name="227511999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227511999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227511999">(Feb 23 2021 at 22:04)</a>:</h4>
<p>You could even be extremely explicit and do <code>Span::allocate_from_iter::&lt;'tcx Span, Span&gt;(self.tcx.arena, iter)</code></p>



<a name="227512084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512084">(Feb 23 2021 at 22:05)</a>:</h4>
<p>err</p>



<a name="227512153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512153">(Feb 23 2021 at 22:05)</a>:</h4>
<p>I see what you mean</p>



<a name="227512370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512370">(Feb 23 2021 at 22:06)</a>:</h4>
<p>Yeah, just uh, change <code>impl IntoIterator</code> into a <code>T: IntoIterator</code></p>



<a name="227512425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512425">(Feb 23 2021 at 22:06)</a>:</h4>
<p>then you can be explicit</p>



<a name="227512897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512897">(Feb 23 2021 at 22:08)</a>:</h4>
<p>Right, adding an extra type parameter there fixes that, but the lifetime error is still there and I don't understand it</p>



<a name="227512949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227512949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227512949">(Feb 23 2021 at 22:09)</a>:</h4>
<p>err wait...</p>



<a name="227513102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513102">(Feb 23 2021 at 22:09)</a>:</h4>
<p>Yeah, you won't be able to be explicit here with removing the <code>impl IntoIterator</code></p>



<a name="227513165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513165">(Feb 23 2021 at 22:10)</a>:</h4>
<p>I'm not 100% what the inference isn't working here</p>



<a name="227513216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513216">(Feb 23 2021 at 22:10)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
   --&gt; compiler/rustc_middle/src/ty/context.rs:197:42
    |
197 |         self.tcx.arena.alloc_from_iter::&lt;&#39;_, Span, Span, _&gt;(iter)
    |                                          ^^
    |
   ::: /home/wilco/p/rust/rust/compiler/rustc_arena/src/lib.rs:736:36
    |
736 |             pub fn alloc_from_iter&lt;&#39;a, T: ArenaAllocatable&lt;&#39;tcx, U&gt;, U, V: IntoIterator&lt;Item = T&gt;&gt;(
    |                                    -- the late bound lifetime parameter is introduced here
    |
    = note: `-D late-bound-lifetime-arguments` implied by `-D warnings`
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #42868 &lt;https://github.com/rust-lang/rust/issues/42868&gt;
</code></pre></div>



<a name="227513353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513353">(Feb 23 2021 at 22:11)</a>:</h4>
<p>And <code>'tcx</code> doesn't work either</p>



<a name="227513413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513413">(Feb 23 2021 at 22:11)</a>:</h4>
<p>give me a second</p>



<a name="227513478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513478">(Feb 23 2021 at 22:11)</a>:</h4>
<p>With the function now being:</p>
<div class="codehilite"><pre><span></span><code>pub fn alloc_from_iter&lt;&#39;a, T: ArenaAllocatable&lt;&#39;tcx, U&gt;, U, V: IntoIterator&lt;Item = T&gt;&gt;(
    &amp;&#39;a self,
    iter: V,
) -&gt; &amp;&#39;a mut [T] {
    T::allocate_from_iter(self, iter)
}```
</code></pre></div>



<a name="227513630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513630">(Feb 23 2021 at 22:12)</a>:</h4>
<p>You could remove the <code>'a</code> entirely right</p>



<a name="227513670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513670">(Feb 23 2021 at 22:12)</a>:</h4>
<p>It's used in the return value</p>



<a name="227513809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513809">(Feb 23 2021 at 22:12)</a>:</h4>
<p>Oh you're right</p>



<a name="227513829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513829">(Feb 23 2021 at 22:12)</a>:</h4>
<p>yeah, just remove it</p>



<a name="227513847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513847">(Feb 23 2021 at 22:13)</a>:</h4>
<p>just change everything to <code>'tcx</code></p>



<a name="227513908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513908">(Feb 23 2021 at 22:13)</a>:</h4>
<p>no, just remove it</p>



<a name="227513940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227513940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227513940">(Feb 23 2021 at 22:13)</a>:</h4>
<p>there's only one lifetime</p>



<a name="227514036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514036">(Feb 23 2021 at 22:13)</a>:</h4>
<p>Also <code>self.tcx.arena.alloc_from_iter::&lt;Span, Span, _&gt;(iter)</code> might work</p>



<a name="227514089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514089">(Feb 23 2021 at 22:13)</a>:</h4>
<p>since that lifetime is late-bound, it's not a param</p>



<a name="227514106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514106">(Feb 23 2021 at 22:13)</a>:</h4>
<p>(Idk if rustc allows that)</p>



<a name="227514154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514154">(Feb 23 2021 at 22:14)</a>:</h4>
<p>I see, yeah that works</p>



<a name="227514213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514213">(Feb 23 2021 at 22:14)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/issues/42868#issuecomment-325647940">https://github.com/rust-lang/rust/issues/42868#issuecomment-325647940</a></p>



<a name="227514291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514291">(Feb 23 2021 at 22:15)</a>:</h4>
<p>That diagnostic is terrible</p>



<a name="227514402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514402">(Feb 23 2021 at 22:16)</a>:</h4>
<p>Interesting how eliding the lifetime changes things here</p>



<a name="227514553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/227514553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#227514553">(Feb 23 2021 at 22:17)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span> So we solved the issue! You can use this:<br>
<code>self.tcx.arena.alloc_from_iter::&lt;Span, Span, _&gt;(iter)</code><br>
And then change the function on <code>Arena</code> to this:</p>
<div class="codehilite"><pre><span></span><code>pub fn alloc_from_iter&lt;T: ArenaAllocatable&lt;&#39;tcx, U&gt;, U, V: IntoIterator&lt;Item = T&gt;&gt;(
    &amp;self,
    iter: V,
) -&gt; &amp;mut [T] {
    T::allocate_from_iter(self, iter)
}
</code></pre></div>



<a name="229730796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/229730796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#229730796">(Mar 10 2021 at 19:49)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> <span class="user-mention" data-user-id="283967">@Zahari Dichev</span> I'm assuming no updates here?</p>



<a name="229733786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/229733786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#229733786">(Mar 10 2021 at 20:06)</a>:</h4>
<p>All that's left of splitting things off TyCtxt is doing the alloc_from_iter change we figured out above, when that's done I think we can start moving types into rustc_type_ir</p>



<a name="229733833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/229733833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#229733833">(Mar 10 2021 at 20:07)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span> Are you still interested in doing this?</p>



<a name="229734435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/229734435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#229734435">(Mar 10 2021 at 20:10)</a>:</h4>
<p>If you're not interested any more or don't have time for this, I could take over</p>



<a name="229759523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/229759523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#229759523">(Mar 10 2021 at 22:33)</a>:</h4>
<p>I was preoccupied with some side things. Will try to move the rest of the methods over this week</p>



<a name="230036646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230036646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230036646">(Mar 12 2021 at 14:24)</a>:</h4>
<p>alright, now that finally compiles. Need to rebase, but there is certainly a good number of things that are probably not ideal with this. Should I post a PR after rebasing?</p>



<a name="230036662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230036662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230036662">(Mar 12 2021 at 14:24)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1">https://github.com/rust-lang/rust/compare/master...zaharidichev:move-encodable-to-type-ir?expand=1</a></p>



<a name="230038723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230038723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230038723">(Mar 12 2021 at 14:36)</a>:</h4>
<p>Not sure if we should land this first or go on with moving the types before merging, but either way a PR would be nice</p>



<a name="230088671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230088671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230088671">(Mar 12 2021 at 20:01)</a>:</h4>
<p>I think this should/can land separately, but also somewhat want to see some examples of this working, if that makes sense? So maybe not all types need to be moved, but maybe the most problematic ones?</p>



<a name="230088707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230088707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230088707">(Mar 12 2021 at 20:01)</a>:</h4>
<p>But nonetheless, a PR would be great to check perf</p>



<a name="230333208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230333208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230333208">(Mar 15 2021 at 12:04)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> <span class="user-mention" data-user-id="232957">@Jack Huey</span>   I have submitted a draft to get some feedback before I move on to moving types. <a href="https://github.com/rust-lang/rust/pull/83142">https://github.com/rust-lang/rust/pull/83142</a>.  Not sure whether all the associated types make sense. Also this at the moment looks very very different than <code>chalk_ir::interner::Interner</code></p>



<a name="230334874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230334874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230334874">(Mar 15 2021 at 12:19)</a>:</h4>
<p>and <a href="http://context.rs">context.rs</a> is too many lines ...</p>



<a name="230335733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230335733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230335733">(Mar 15 2021 at 12:26)</a>:</h4>
<p>Nice, I'll take a look later today</p>



<a name="230335786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230335786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230335786">(Mar 15 2021 at 12:27)</a>:</h4>
<p>The point isn't to get the interners the same in one go, we can slowly get them closer together over time once we have something in</p>



<a name="230336012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230336012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230336012">(Mar 15 2021 at 12:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="283967">Zahari Dichev</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/230334874">said</a>:</p>
<blockquote>
<p>and <a href="http://context.rs">context.rs</a> is too many lines ...</p>
</blockquote>
<p>Does it hit a max rustc file length lint somewhere, or do you mean it's just a lot of boilerplate?</p>



<a name="230336807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230336807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230336807">(Mar 15 2021 at 12:36)</a>:</h4>
<p>hits the lint, I will add an ignore Feel free to take a look, also a suggestion for next steps will be very good (a collection of particular types to move?). I am still a bit lost around the codebase tbh</p>



<a name="230337479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230337479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230337479">(Mar 15 2021 at 12:42)</a>:</h4>
<p>Well, we're trying to check whether the approach will work, so it's best to pick a tricky type. Maybe one that's mentioned in <code>impl_ty_decoder_arena_type!</code>, and one of the types that are returned from an <code>alloc_from_iter</code> call</p>



<a name="230351813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230351813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230351813">(Mar 15 2021 at 14:20)</a>:</h4>
<p>I think we could move the <code>Interner</code> impl into a <code>ty/interner.rs</code> module</p>



<a name="230352008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230352008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230352008">(Mar 15 2021 at 14:21)</a>:</h4>
<p>Also, looking over this, I wonder if it's worth trying generalize <code>alloc_from_iter</code> <em>now</em></p>



<a name="230352484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230352484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230352484">(Mar 15 2021 at 14:24)</a>:</h4>
<p>i.e. add some kind of <code>trait InternerAllocable { type Target; }</code>, <code>trait Interner { fn alloc_from_iter&lt;T: InternerAllocable&gt;(t: T) -&gt; T::Target; }</code>, <code>impl&lt;'tcx, T: ArenaAllocatable&lt;'tcx&gt;&gt; InternerAllocable for T { ... }</code></p>



<a name="230352654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230352654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230352654">(Mar 15 2021 at 14:25)</a>:</h4>
<p>(though that last impl might be a problem in terms of coherence, might have to manually impl individual types or create another extension trait or something)</p>



<a name="230537597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/230537597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#230537597">(Mar 16 2021 at 15:54)</a>:</h4>
<p>I started trying to move some of the types over. Will post an update soon.</p>



<a name="231547986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/231547986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#231547986">(Mar 23 2021 at 21:37)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span>  I took another look at the <code>alloc_from_iter</code> calls, and turns out we can simplify things a lot by just adding a lifetime to the <code>Interner</code> trait:</p>
<div class="codehilite"><pre><span></span><code>impl&lt;&#39;tcx&gt; Interner&lt;&#39;tcx&gt; for TyInterner&lt;&#39;tcx&gt; {
    fn alloc_from_iter&lt;T: Copy&gt;(self, iter: impl IntoIterator&lt;Item = T&gt;) -&gt; &amp;&#39;tcx mut [T] {
        self.tcx.arena.alloc_from_iter(iter)
    }
</code></pre></div>
<p>That limits the interned types to slice references of course, but we can avoid all the associated types and <code>alloc_*_from_iter</code> functions that way</p>



<a name="231549826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/231549826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#231549826">(Mar 23 2021 at 21:52)</a>:</h4>
<p>The only thing I would say is be aware of how the <code>Interner</code> looks like in Chalk. I.e. do we eventually want to add a lifetime there?</p>



<a name="240092066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/240092066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#240092066">(May 24 2021 at 18:33)</a>:</h4>
<p>FYI I've picked up <a href="https://github.com/rust-lang/rust/issues/83142">#83142</a> to try to rebase it onto master</p>



<a name="240092242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/240092242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#240092242">(May 24 2021 at 18:34)</a>:</h4>
<p>I don't know how close to finished it was</p>



<a name="240095547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/240095547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#240095547">(May 24 2021 at 18:58)</a>:</h4>
<p>I don't remember. I think maybe we were trying to figure out what the end product is going to look like</p>



<a name="243169058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243169058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243169058">(Jun 18 2021 at 14:35)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/rust/issues/86435">#86435</a>, I've just "blindly" rebased and made it compile</p>



<a name="243175981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243175981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243175981">(Jun 18 2021 at 15:28)</a>:</h4>
<p>Ooh nice</p>



<a name="243176992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243176992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243176992">(Jun 18 2021 at 15:36)</a>:</h4>
<p>We/I should go through and review what the "end goal" is going to look like. A few HackMDs are around <a href="https://hackmd.io/DYGeIIHHSQah6g86piR1dQ">https://hackmd.io/DYGeIIHHSQah6g86piR1dQ</a> <a href="https://hackmd.io/K8cPSWn3So2GlPPvPuktAQ">https://hackmd.io/K8cPSWn3So2GlPPvPuktAQ</a></p>



<a name="243177017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243177017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243177017">(Jun 18 2021 at 15:36)</a>:</h4>
<p>I'll try to look at this PR today and give some meaningful feedback</p>



<a name="243177024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243177024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243177024">(Jun 18 2021 at 15:36)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span></p>



<a name="243177073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243177073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243177073">(Jun 18 2021 at 15:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/243176992">said</a>:</p>
<blockquote>
<p>We/I should go through and review what the "end goal" is going to look like. A few HackMDs are around <a href="https://hackmd.io/DYGeIIHHSQah6g86piR1dQ">https://hackmd.io/DYGeIIHHSQah6g86piR1dQ</a> <a href="https://hackmd.io/K8cPSWn3So2GlPPvPuktAQ">https://hackmd.io/K8cPSWn3So2GlPPvPuktAQ</a></p>
</blockquote>
<p>Will take a look</p>



<a name="243179358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243179358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243179358">(Jun 18 2021 at 15:55)</a>:</h4>
<p>nice, <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span></p>



<a name="243190286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190286">(Jun 18 2021 at 17:41)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> you around?</p>



<a name="243190303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190303">(Jun 18 2021 at 17:41)</a>:</h4>
<p>Yes <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="243190398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190398">(Jun 18 2021 at 17:42)</a>:</h4>
<p>So, since <code>TyDecoder</code> is going to stay in <code>rustc_middle</code>, that should be able to keep the <code>fn tcx(&amp;self) -&gt; TyCtxt&lt;'tcx&gt;;</code>, right?</p>



<a name="243190457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190457">(Jun 18 2021 at 17:43)</a>:</h4>
<p>Sorry, I haven't read the hackmds yet</p>



<a name="243190472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190472">(Jun 18 2021 at 17:43)</a>:</h4>
<p>Then, <code>Interner</code> doesn't need some of the alloc functions, like <code>set_alloc_id_same_memory</code></p>



<a name="243190488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190488">(Jun 18 2021 at 17:43)</a>:</h4>
<p>No worries</p>



<a name="243190576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190576">(Jun 18 2021 at 17:44)</a>:</h4>
<p>So we're only trying to move <code>Encodable</code>/<code>Decodable</code> but not <code>TyEncodable</code>/<code>TyDecodable</code>?</p>



<a name="243190700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190700">(Jun 18 2021 at 17:45)</a>:</h4>
<p><code>Encodable</code> will still stay in <code>rustc_serialize</code>, maybe</p>



<a name="243190829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190829">(Jun 18 2021 at 17:47)</a>:</h4>
<p>Oh, I remember, there are no TyEncoable/TyDecodable traits</p>



<a name="243190848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190848">(Jun 18 2021 at 17:47)</a>:</h4>
<p>Correct</p>



<a name="243190877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190877">(Jun 18 2021 at 17:47)</a>:</h4>
<p>Do you have time now to play with this, or should I just pull your branch and play</p>



<a name="243190943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190943">(Jun 18 2021 at 17:48)</a>:</h4>
<p>I have time, but I don't know what I should play with</p>



<a name="243190988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190988">(Jun 18 2021 at 17:48)</a>:</h4>
<p>Honestly, I'm lost on this, I only rebased a PR <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="243190999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243190999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243190999">(Jun 18 2021 at 17:48)</a>:</h4>
<p>No worries</p>



<a name="243191019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191019">(Jun 18 2021 at 17:48)</a>:</h4>
<p>Can you try keeping <code>fn tcx()</code> on <code>TyDecoder</code>?</p>



<a name="243191024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191024">(Jun 18 2021 at 17:48)</a>:</h4>
<p>Instead of <code>interner()</code></p>



<a name="243191056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191056">(Jun 18 2021 at 17:49)</a>:</h4>
<p>You mean <code>Decoder</code> then, no?</p>



<a name="243191159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191159">(Jun 18 2021 at 17:50)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/86435/files#diff-0cd144a40ce608d62363b9d675d5b18f775b2eab49111d54880cc04994f540d5R164">no</a></p>



<a name="243191169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191169">(Jun 18 2021 at 17:50)</a>:</h4>
<p>Ah nevermind</p>



<a name="243191228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191228">(Jun 18 2021 at 17:51)</a>:</h4>
<p>There's no <code>TyDecodable</code>/<code>TyEncodable</code>, but there is <code>TyEncoder</code>/<code>TyDecoder</code></p>



<a name="243191260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191260">(Jun 18 2021 at 17:51)</a>:</h4>
<p>Ok, so loosely speaking the plan is "generic <code>TyInterner</code> in <code>Encodable</code>/<code>Decodable</code>, but we can use <code>TyCtxt</code> in the decoders because they'll stay in rustc"</p>



<a name="243191350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191350">(Jun 18 2021 at 17:52)</a>:</h4>
<p>We can use <code>TyCtxt</code> in <code>TyDecoder</code>, since that will stay in rustc, yes</p>



<a name="243191372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191372">(Jun 18 2021 at 17:53)</a>:</h4>
<p>Then, we should be able to remove some functions from <code>Interner</code></p>



<a name="243191377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191377">(Jun 18 2021 at 17:53)</a>:</h4>
<ul>
<li><code>set_alloc_id_same_memory</code></li>
</ul>



<a name="243191393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191393">(Jun 18 2021 at 17:53)</a>:</h4>
<ul>
<li><code>create_fn_alloc</code></li>
</ul>



<a name="243191408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191408">(Jun 18 2021 at 17:53)</a>:</h4>
<ul>
<li><code>create_static_alloc</code></li>
</ul>



<a name="243191473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191473">(Jun 18 2021 at 17:54)</a>:</h4>
<ul>
<li><code>reserve_alloc_id</code></li>
</ul>



<a name="243191521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191521">(Jun 18 2021 at 17:55)</a>:</h4>
<ul>
<li><code>insert_same_cached_ty</code> and <code>get_cached_ty</code>, I think</li>
</ul>



<a name="243191601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191601">(Jun 18 2021 at 17:56)</a>:</h4>
<p>That's a start</p>



<a name="243191654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191654">(Jun 18 2021 at 17:56)</a>:</h4>
<p>There's one thing I don't understand, don't all the types that use <code>#[derive(TyEncodable)]</code> depend on <code>TyDecoder</code>?</p>



<a name="243191670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191670">(Jun 18 2021 at 17:56)</a>:</h4>
<p>Or is that actually not needed</p>



<a name="243191684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191684">(Jun 18 2021 at 17:56)</a>:</h4>
<p>The alloc functions I think we can also make more general. Or at least remove some</p>



<a name="243191739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191739">(Jun 18 2021 at 17:57)</a>:</h4>
<p>Yes</p>



<a name="243191764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191764">(Jun 18 2021 at 17:57)</a>:</h4>
<p>All types that derive <code>TyEncodable</code> or <code>TyDecodable</code> need <code>TyDecoder</code> or <code>TyEncoder</code></p>



<a name="243191776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243191776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243191776">(Jun 18 2021 at 17:57)</a>:</h4>
<p><em>I think</em></p>



<a name="243193382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243193382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243193382">(Jun 18 2021 at 18:14)</a>:</h4>
<p>Yeah, there are a lot of impls where we have a <code>D: TyDecodable</code> and we don't need the alloc function and associated type and such in <code>Interner</code></p>



<a name="243193440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243193440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243193440">(Jun 18 2021 at 18:15)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> like I said, just let me know if you don't have time and want me to take a stab. Could use a break from looking at the normalization under binders</p>



<a name="243193612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243193612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243193612">(Jun 18 2021 at 18:17)</a>:</h4>
<p>Currently reading, trying to catch up, so if you wanted to try something go ahead</p>



<a name="243199752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243199752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243199752">(Jun 18 2021 at 19:27)</a>:</h4>
<p>Just pushed some changes. Have some more in the works</p>



<a name="243216774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243216774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243216774">(Jun 18 2021 at 23:35)</a>:</h4>
<p>I basically got into the weeds of moving TyKind to rustc_type_ir as an example</p>



<a name="243216784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243216784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243216784">(Jun 18 2021 at 23:35)</a>:</h4>
<p>The HashStable, Encodable, and Decodable impls are rough</p>



<a name="243216910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243216910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243216910">(Jun 18 2021 at 23:38)</a>:</h4>
<p>Forever wishing for a way to derive on foreign types</p>



<a name="243323450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243323450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243323450">(Jun 20 2021 at 21:50)</a>:</h4>
<p>Well, we aren't allowed to write</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="p">,</span><span class="w"> </span><span class="n">CTX</span><span class="p">,</span><span class="w"> </span><span class="n">E</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Encodable</span><span class="o">&lt;</span><span class="n">E</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">rustc_type_ir</span>::<span class="n">TyKind</span><span class="o">&lt;</span><span class="n">TyCtxt</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;&gt;</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">E</span>: <span class="nc">TyEncoder</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="o">..</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="243323461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243323461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243323461">(Jun 20 2021 at 21:51)</a>:</h4>
<p>That violates the orphan rule</p>



<a name="243323685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243323685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243323685">(Jun 20 2021 at 21:56)</a>:</h4>
<p>The other way around would work if it weren't for the <code>Encodable for [u8]</code> specialization I think.</p>



<a name="243334559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243334559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243334559">(Jun 21 2021 at 02:53)</a>:</h4>
<p>What do you mean other way around?</p>



<a name="243334615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243334615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243334615">(Jun 21 2021 at 02:54)</a>:</h4>
<p>I think probably the easiest/best solution <em>for now</em> (might change later), is to just move <code>TyEncoder</code> into <code>rustc_type_ir</code> and keep these impls there</p>



<a name="243334681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243334681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243334681">(Jun 21 2021 at 02:56)</a>:</h4>
<p>But then <code>Ty</code> and <code>PredicateKind</code> have to go together because of the <code>type_shorthands</code> and <code>predicate_shorthands</code></p>



<a name="243334715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243334715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243334715">(Jun 21 2021 at 02:57)</a>:</h4>
<p>It would be interesting to try change that to be a map keyed by type id to hashmap of shorthands</p>



<a name="243334762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243334762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243334762">(Jun 21 2021 at 02:58)</a>:</h4>
<p>But I feel like this is perf sensitive and that one extra level of lookups wouldn't be great</p>



<a name="243355265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243355265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243355265">(Jun 21 2021 at 09:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60/near/243334559">said</a>:</p>
<blockquote>
<p>What do you mean other way around?</p>
</blockquote>
<p>Never mind, read your code wrong.</p>



<a name="243406999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243406999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243406999">(Jun 21 2021 at 16:21)</a>:</h4>
<p>:/</p>



<a name="243411008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243411008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243411008">(Jun 21 2021 at 16:54)</a>:</h4>
<p>Well, okay. So trying to move <code>TyEncoder</code> to <code>rustc_type_ir</code>. And I'd like to do something like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Interner</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Encodable</span><span class="o">&lt;</span><span class="n">E</span>: <span class="nc">Encoder</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Encoder</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">TyEncoder</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">Interner</span><span class="o">&gt;</span>: <span class="nc">Encoder</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">enum</span> <span class="nc">BoundTyKind</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">Interner</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">TyEncoder</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">Encodable</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">BoundTyKind</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>
<p>but of course that impl at the bottom isn't  allowed because <code>I</code> isn't constrained</p>



<a name="243411124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243411124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243411124">(Jun 21 2021 at 16:55)</a>:</h4>
<p><code>TyEncoder</code> really looks like:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">TyEncoder</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">Interner</span><span class="o">&gt;</span>: <span class="nc">Encoder</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">CLEAR_CROSS_CRATE</span>: <span class="kt">bool</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">position</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">usize</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">type_shorthands</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">FxHashMap</span><span class="o">&lt;</span><span class="n">I</span>::<span class="n">Ty</span><span class="p">,</span><span class="w"> </span><span class="kt">usize</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">predicate_shorthands</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">FxHashMap</span><span class="o">&lt;</span><span class="n">I</span>::<span class="n">PredicateKind</span><span class="p">,</span><span class="w"> </span><span class="kt">usize</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">encode_alloc_id</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">alloc_id</span>: <span class="kp">&amp;</span><span class="nc">I</span>::<span class="n">AllocId</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="p">(),</span><span class="w"> </span><span class="bp">Self</span>::<span class="n">Error</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="243412128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243412128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243412128">(Jun 21 2021 at 17:02)</a>:</h4>
<p>Guess an associated type works here</p>



<a name="243415749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243415749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243415749">(Jun 21 2021 at 17:31)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">__I</span>: <span class="nc">Interner</span><span class="p">,</span><span class="w"> </span><span class="n">__E</span>: <span class="nc">TyEncoder</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="n">__I</span><span class="o">&gt;</span><span class="w"></span>
<span class="w">    </span><span class="k">where</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">DelaySpanBugEmitted</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">AdtDef</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">SubstsRef</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">DefId</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">Ty</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">Const</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">Region</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">TypeAndMut</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">Mutability</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">Movability</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">PolyFnSig</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">ListBinderExistentialPredicate</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">BinderListTy</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">ProjectionTy</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">ParamTy</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">BoundTy</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">PlaceholderType</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">InferTy</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">DelaySpanBugEmitted</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">PredicateKind</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">__I</span>::<span class="n">AllocId</span>: <span class="nc">Encodable</span><span class="o">&lt;</span><span class="n">__E</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
</code></pre></div>
<p>So that...works</p>



<a name="243431735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243431735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243431735">(Jun 21 2021 at 19:34)</a>:</h4>
<p>Oh my gosh this is so terrible</p>



<a name="243432199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243432199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243432199">(Jun 21 2021 at 19:38)</a>:</h4>
<p>Okay just have some mysterious "hidden type for <code>impl Trait</code> captures lifetime that does not appear in bounds" to figure out and I think I have it compiling with <code>TyKind</code> moved to <code>rustc_type_ir</code></p>



<a name="243435039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435039">(Jun 21 2021 at 20:01)</a>:</h4>
<p>I think moving types around must have changed the variance of something somewhere because now I'm getting a bunch of lifetime errors</p>



<a name="243435124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435124">(Jun 21 2021 at 20:01)</a>:</h4>
<p>I'm getting errors like</p>
<div class="codehilite"><pre><span></span><code>error: lifetime may not live long enough
   --&gt; compiler/rustc_middle/src/mir/interpret/value.rs:604:9
    |
567 | impl&lt;&#39;tcx, Tag&gt; ScalarMaybeUninit&lt;Tag&gt; {
    |      ---- lifetime `&#39;tcx` defined here
...
604 |         self.check_init()?.to_f64()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `&#39;tcx` must outlive `&#39;static`
    |
    = help: consider replacing `&#39;tcx` with `&#39;static`
</code></pre></div>



<a name="243435267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435267">(Jun 21 2021 at 20:02)</a>:</h4>
<p>I think maybe it's because <code>TyKind</code> no longer takes a <code>'tcx</code> but rather a <code>I: Interner</code></p>



<a name="243435306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435306">(Jun 21 2021 at 20:03)</a>:</h4>
<p>Where in <code>rustc_middle</code> there's a <code>type TyKind&lt;'tcx&gt; = IrTypeKind&lt;TyInterner&lt;'tcx&gt;&gt;</code></p>



<a name="243435410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435410">(Jun 21 2021 at 20:04)</a>:</h4>
<p>SOS <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="243435435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435435">(Jun 21 2021 at 20:04)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="243435442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435442">(Jun 21 2021 at 20:04)</a>:</h4>
<p>sorry I've been so afk</p>



<a name="243435457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435457">(Jun 21 2021 at 20:04)</a>:</h4>
<p>I'll be resurfacing for trait-related things on thu I think</p>



<a name="243435620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435620">(Jun 21 2021 at 20:06)</a>:</h4>
<p>I'll be off of vacation on thursday</p>



<a name="243435648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435648">(Jun 21 2021 at 20:06)</a>:</h4>
<p>do you have a minute to give thoughts?</p>



<a name="243435678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435678">(Jun 21 2021 at 20:06)</a>:</h4>
<p>uh</p>



<a name="243435684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435684">(Jun 21 2021 at 20:06)</a>:</h4>
<p>is there a branch I can try?</p>



<a name="243435713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435713">(Jun 21 2021 at 20:06)</a>:</h4>
<p>I can push what I have</p>



<a name="243435723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435723">(Jun 21 2021 at 20:06)</a>:</h4>
<p>that'd be helpful</p>



<a name="243435828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243435828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243435828">(Jun 21 2021 at 20:07)</a>:</h4>
<p><a href="https://github.com/LeSeulArtichaut/rust/tree/zd/type-interner-5">https://github.com/LeSeulArtichaut/rust/tree/zd/type-interner-5</a></p>



<a name="243437053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243437053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243437053">(Jun 21 2021 at 20:17)</a>:</h4>
<p>Not the errors I expected to hit tbh</p>



<a name="243437347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243437347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243437347">(Jun 21 2021 at 20:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> honestly, I don't think it'll compile past rustc_middle, but the rough part is rustc_middle itself</p>



<a name="243455832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243455832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243455832">(Jun 21 2021 at 23:24)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> any luck?</p>



<a name="243457730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243457730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243457730">(Jun 21 2021 at 23:51)</a>:</h4>
<p>no-- haven't had time :( sorry, will try to do so soon</p>



<a name="243812446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Moving%20%60TyEncodable%60/%60TyDecodable%60%20to%20%60rustc_typeir%60/near/243812446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Moving.20.60TyEncodable.60.2F.60TyDecodable.60.20to.20.60rustc_typeir.60.html#243812446">(Jun 24 2021 at 16:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>